﻿/*
 * The interfaces and classes in this file are examples of the sort of strongly typed metadata objects that you would indirectly associate
 * with enum instances. The association is indirect, because the enum instances are actually decorated with attributes, and then the EnumMetadata
 * library harvests the data from those attributes and moves it into instances of these metadatat objects, which callers can more easily consume.
 * 
 * The pattern for creating these metadata objects generally involves using an interface/implementation pairs, as this allows the interface to be the main 
 * public contact point and thus greater testability. However, the interfaces are not strictly required.
 * 
 */
namespace com.ddmresources.EnumMetadata.Samples
{
    #region Metadata Interfaces
    //ClientStatus
    public interface IClientStatusInfo
    {
        int Id { get; set; }
        string Code { get; set; }
        string Description { get; set; }
        bool IsMapped { get; set; }
    }

    //TrafficLightColor
    public interface ITrafficLightColorInfo
    {
        int Wavelength { get; set; }
        string IntendedAction { get; set; }
        bool IsColorBlind { get; set; }
        int[] NTSBRegulations { get; set; }
        SubData Example { get; set; }
    }

    //CodeTableInfo
    //the implementing class is actually a subtype of Attribute and is in a separate file
    public interface ICodeTableInfo
    {
        int MappedId { get; set; }            //a database id column, or the like
        string MappedCode { get; set; }      //a database lookup table code field, or the like
        string ShortName { get; set; }       //short name suitable for use in UI
        string LongName { get; set; }        //long name suitable for use in UI when more space is available
        string Description { get; set; }     //full description of the enum value represents
        string Tag { get; set; }
    }


    //HelpTopicInfo
    //the implementing class is actually a subtype of Attribute and in a separate file
    public interface IHelpTopicInfo
    {
        string Id { get; set; }
        bool IsContentCrossCompany { get; set; }
        string SkinName { get; set; }
    }
    #endregion

    #region Metadata Implementations
    public class ClientStatusInfo : IClientStatusInfo
    {
        public int Id { get; set; }
        public string Code { get; set; }
        public string Description { get; set; }
        public bool IsMapped { get; set; }
    }

    public class TrafficLightColorInfo : ITrafficLightColorInfo
    {
        public int Wavelength { get; set; }
        public string IntendedAction { get; set; }
        public bool IsColorBlind { get; set; }
        public int[] NTSBRegulations { get; set; }
        public SubData Example { get; set; }
    }

    public class SubData
    {
        public int Id { get; set; }
        public string Desc { get; set; }
    } 
    #endregion
}
